<template>
  <div class="app-container" >
    <el-card class="filter-container" shadow="never">
      <div style="margin-top: 15px">
        <el-form :inline="true" size="small">
          <el-select v-model="valueName" size="small" style="width: 125px">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
          <el-form-item>
            <el-input v-model="input" placeholder="请输入搜索内容" style="width: 250px"></el-input>
          </el-form-item>
          <el-button type="info" icon="el-icon-search" size="small"></el-button>
        </el-form>
        <span>时间</span>
        <el-date-picker
            size="small"
            v-model="plan_s"
            type="datetime"
            align="right"
            placeholder="开始">
        </el-date-picker>
        <i class="el-icon-caret-right"></i>
        <el-date-picker
            size="small"
            v-model="plan_e"
            type="datetime"
            align="right"
            placeholder="结束">
        </el-date-picker>
      </div>
    </el-card>
    <el-table :data="value"
              v-loading="listLoading"
              style="margin-top: 15px;width:100%"
              border>
      <el-table-column label="业务时间" align="center">
      <template slot-scope="scope">{{scope.row.business_time}}</template>
      </el-table-column>
      <el-table-column label="退款单号"  align="center">
      <template slot-scope="scope">{{scope.row.refund_no}}</template> 
      </el-table-column>
    <el-table-column label="会员姓名"prop="member_name" align="center">
    <template slot-scope="scope">{{scope.row.member_name}}</template>
    </el-table-column>
<!--      <el-table-column label="床位" prop="bed" align="center">-->
<!--        <template slot-scope="scope">{{scope.account.beds}}</template>-->
      <el-table-column label="退款类型"  align="center">
        <template slot-scope="scope">{{scope.row.payment_type}}</template>
      </el-table-column>
      <el-table-column label="退款金额(元)" prop="amount" align="center">
        <template slot-scope="scope">{{scope.row.voucher_no}}}</template>
      </el-table-column>
      <el-table-column label="退款状态" prop="status" align="center">
        <template slot-scope="scope">{{scope.row.refund_status}}</template>
      </el-table-column>
      <el-table-column label="退款日期" prop="date" align="center">
        <template slot-scope="scope">{{scope.row.business_time}}</template>
      </el-table-column>
    </el-table>
    <div class="pagination-container">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[5, 10, 15]"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
  import {refundList} from "@/api/fmg";
  import {fetchList,closeOrder,deleteOrder,getList,deleteMulOrder} from '@/api/order'


  export default {
    name: 'refund',
    data() {
      return{
        total: 1,
        currentPage: 5,
        options:[{
          value:'1', label:'退款单号'
        }, {
          value:'2', label:'会员姓名'
        }, {
          value: '3', label: '床号'
        }],
        plan_s: '',
        plan_e: '',
        valueName: '1',
        valueY: '1',
        valueCost: '1',
        input: '',
        value: null,
        page: 1,
        pageSize: 15,
        listLoading: false,
        adddata:
       {
         id: 2,
         created_at: "1983-04-17 03:28:07",
         updated_at: "1983-04-17 03:28:07",
         business_time: "2009-04-20 09:16:40",
         refund_no: "FK2009042040956751",
         account_id: 12,
         refund_type: "变更收费",
         refund_amount: "1498.91",
         spending_way: "刷卡",
        refund_status: "未退款",
         refund_date: null,
         agent: "袁龙",
         note: "Quia ut quam sit possimus mollitia libero iusto veritatis.",
         real_refund: "848.49",
         deposit: "567.52",
        refund_name: "molestiae",
         account: {
           id: 12,
           created_at: "1982-01-04 02:14:12",
           updated_at: "1982-01-04 02:14:12",
           account_number: "A3568779",
           member_number: "8641",
           member_name: "许成",
           beds: "3号楼-6-269-217",
           account_balance: "6193.15",
           beds_cost: "473.41",
           meal_cost: "481.72",
           nursing_cost: "188.34",
           other_cost: "281.86",
           cd_card: "503098838085068286",
           deposit: "1375.65" 
        } 
      },
       
         id: 4,
         created_at: "2009-06-20 23:50:27",
         updated_at: "2009-06-20 23:50:27",
         business_time: "2014-12-07 15:14:35",
         refund_no: "FK2014120726140587",
         account_id: 2,
         refund_type: "变更收费",
         refund_amount: "4905.54",
         spending_way: "刷卡",
         refund_status: "未退款",
         refund_date: null,
         agent: "于文彬",
         note: "Aut iste ut deserunt quam ut minus.",
         real_refund: "894.80",
         deposit: "671.97",
         refund_name: "error",
         account: {
           id: 2,
           created_at: "1988-10-02 09:59:56",
           updated_at: "1988-10-02 09:59:56",
           account_number: "A5653591",
           member_number: "1196",
           member_name: "来淑英",
           beds: "3号楼-2-717-768",
           account_balance: "6423.63",
           beds_cost: "419.61",
           meal_cost: "679.22",
           nursing_cost: "25.65",
           other_cost: "463.22",
           cd_card: "492822069600925021",
           deposit: "835.90" 
        } 
       
      } 
      
    },
    created() {
      this.getTableData();
    },
    methods: {
      getTableData() {
        this.listLoading = true;
        refundList(this.number,'/financial-management/refund/').then(response => {
          this.listLoading = false;
          this.value = response.data.data;
          this.total = response.data.total;
        })
      },
      handleSizeChange(val) {
        console.log('???');
      },
      handleCurrentChange(val) {
        console.log('!!');
      }
    }
  }
</script>

<stype>

</stype>
